/*
 * @Author: 李一番 
 * @Date: 2022-01-05 10:26:17 
 * @Last Modified by: 李一番
 * @Last Modified time: 2022-01-05 10:26:52
 */

/**
 * 10000 => "10,000"
 * @param num 
 * @returns 
 */
export function toThousandFilter(num: string | number) {
  return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
}